
using System;
using System.Collections;

namespace Sedna.Core.Persistence
{
    /// <summary>
    /// Implementations of this interface are responsible for obtaining data of any kind: custom or persistent.
    /// It's care about data specific properties but it isn't care about filter specific.
    /// </summary>
    public interface IDataProvider : ICloneable
    {
        /// <summary>
        /// The zero-based index of a first record to be retrieved.
        /// If StartIndex is less than zero, its value doesn't consider.
        /// </summary>
        int StartIndex { get; set;}
        
        /// <summary>
        /// Amount's consider only in case StartIndex isn't negative and
        /// its own value isn't negative
        /// </summary>
        int Amount { get; set;}
        
        bool IsAsc { get; set;}
        String SortExpression { get; set;}

        ICollection LoadData();

        /// <summary>
        /// The TotalAmount value could be available only after LoadData method was called.
        /// A less than zero result signals TotalAmount is undefined
        /// </summary>
        int TotalAmount { get;}
    }
}
